// pages/admin/admin.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    level: '',
    shouquanImg: '/assets/imgs/shenpi.png',
    labelImg: '/assets/imgs/team.png',
    teamImg: '/assets/imgs/mark.png',
    projectImg: '/assets/imgs/project.png',
  },
  gotoApproval: function() {
    // 跳转到approval授权审批页面
    if (this.data.level == 2) {
      wx.navigateTo({
        url: '/pages/approval/approval'
      })
    } else if (this.data.level == 1) {
      wx.navigateTo({
        url: '/pages/basicEmpower/basicEmpower'
      })
    }

  },
  gotoLabelAudit: function() {
    // 跳转到labelAudit标签审核页面
    wx.navigateTo({
      url: '/pages/labelAudit/labelAudit',
    })
  },
  gotoTeamManagement: function() {
    // 跳转到teamManagement团队管理页面
    wx.navigateTo({
      url: '/pages/teamManagement/teamManagement',
    })
  },
  gotoProject: function() {
    // 跳转到项目管理页
    wx.navigateTo({
      url: '/pages/projectManagement/projectManagement',
    })
  },


  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    let _this = this
    wx.getStorage({
      key: 'level',
      success: function(res) {
        _this.setData({
          level: res.data
        })
      },
    })


  },
  onShow: function() {
    wx.showTabBar()
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function() {

  }
})